package com.zjmy.service.impl;

import com.zjmy.model.User;
import com.zjmy.service.UserService;
import org.springframework.stereotype.Service;

import java.util.Arrays;
import java.util.List;

@Service
public class UserServiceImpl implements UserService {

    public void addUser(User user){
        System.out.println("addUser is execute");
    }

    public User getUser(User user){
//        try {
//            Thread.sleep(30000);
//        } catch (InterruptedException e) {
//            e.printStackTrace();
//        }
//        System.out.println("getUser 一个参数");
        return user;
    }

    public List<User> getUsers(User user){
//        System.out.println("getUser 一个参数");
        return Arrays.asList(user);
    }

    @Override
    public User getUser(String name, User user) {
//        System.out.println("getUser 两个参数");
        return user;
    }

    @Override
    public User test(User user) {
        return user;
    }

    @Override
    public String testStr(String s) {
        return s;
    }

    @Override
    public User testStr2() {
        User user = new User();
        user.setYears(11);
        return user;
    }
}
